package cc.tuhaolicai.mt.user.mobile.business.model;

import com.google.common.base.MoreObjects;
import org.asyou.mongo.annotation.Collection;

import java.util.Date;
import java.util.List;

/**
 * 业务链实体类
 */
@Collection(name = "new_workflow")
public class Workflow implements java.io.Serializable {
    /**
     * 主键
     */
    private Long id;

    /**
     * 当前业务链名称
     */
    private String name;

    /**
     * 当前业务链状态
     * 0：表示开始
     * 1：表示成功
     * 2：表示失败
     */
    private Integer status;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 执行节点
     */
    private List<Node> nodeLinkedList;

    /**
     * 执行结果说明
     */
    private String result;

    /**
     * 添加时间
     */
    private Date addTime;

    public Long getId() {
        return id;
    }

    public Workflow setId(Long id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public Workflow setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public Workflow setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public Workflow setOrderNo(String orderNo) {
        this.orderNo = orderNo;
        return this;
    }

    public String getResult() {
        return result;
    }

    public Workflow setResult(String result) {
        this.result = result;
        return this;
    }

    public Date getAddTime() {
        return addTime;
    }

    public Workflow setAddTime(Date addTime) {
        this.addTime = addTime;
        return this;
    }

    public List<Node> getNodeLinkedList() {
        return nodeLinkedList;
    }

    public Workflow setNodeLinkedList(List<Node> nodeLinkedList) {
        this.nodeLinkedList = nodeLinkedList;
        return this;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("id", id)
                .add("name", name)
                .add("status", status)
                .add("orderNo", orderNo)
                .add("nodeLinkedList", nodeLinkedList)
                .add("result", result)
                .add("addTime", addTime)
                .toString();
    }
}
